
# 对应tutorial中的内容
set(CREATIONAL_DESIGN_PATTERNS_LIST
    Singleton01
    builder
    builder01
    builder02
    Prototype
    Prototype01

    FactoryPattern
    )


file(GLOB cpps RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*/*.cpp")

foreach(mainfile IN LISTS cpps)
    get_filename_component(mainname ${mainfile} NAME_WE)

    list(FIND CREATIONAL_DESIGN_PATTERNS_LIST ${mainname} index)

    if(NOT index EQUAL -1)
        add_executable(${mainname} ${mainfile})
        # target_link_libraries(${mainname} pthread tbb)
    endif()
endforeach()
